﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LBase.aspx.cs" Inherits="Viewer.Base.LBase" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/Base/SimpleListBase.ascx" TagName="UCSimpleListBase" TagPrefix="uc" %>
<%@ Register Src="~/Base/SimpleDetailBase.ascx" TagName="UCSimpleDetailBase" TagPrefix="uc" %>
<%@ Register Src="~/ToChucHanhChinh/UserControl/AddToChucHanhChinh.ascx" TagName="UCAddToChucHanhChinh" TagPrefix="uc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../resources/css/main.css" rel="stylesheet" type="text/css" />
    <title></title>
</head>
<body>
    <ext:ResourceManager ID="RemBase" runat="server" Locale="vi" >
          <Listeners>
            <DocumentReady Handler="Ext.net.DirectEvent.timeout = 360000;" />
            <AjaxRequestException Handler="Ext.net.Mask.hide();" />
            <BeforeAjaxRequest Handler="Ext.net.Mask.show();" />
            <AjaxRequestComplete Handler="Ext.net.Mask.hide();" />
        </Listeners>
    </ext:ResourceManager>
    <form id="Form1" runat="server">
    <ext:Viewport ID="ViewPortMain" runat="server">
        <Items>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North MinHeight="600">
                    <ext:Panel ID="PnSearch" runat="server" Border="false" Region="North"   ButtonAlign="Left" Padding="10" >
                        <Items>
                            <ext:CompositeField runat="server">
                                <Items>
                                    <ext:ComboBox ID="cboXepHang" runat="server" DisplayField="CodeValue" ValueField="CodeID"
                                        EmptyText="Chọn xếp hạng"  Width="150">
                                        <Store>
                                            <ext:Store ID="storeXepHang" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="CodeID">
                                                        <Fields>
                                                            <ext:RecordField Name="CodeID" />
                                                            <ext:RecordField Name="CodeValue" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                        </Triggers>
                                        <Listeners>
                                            <Select Handler="this.triggers[0].show();" />
                                            <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                            <TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
                                        </Listeners>
                                    </ext:ComboBox>
                                    <ext:ComboBox ID="cboKhoi" runat="server" DisplayField="CodeValue" ValueField="CodeID"
                                        EmptyText="Chọn khối"  Width="150">
                                        <Store>
                                            <ext:Store ID="storeKhoi" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="CodeID">
                                                        <Fields>
                                                            <ext:RecordField Name="CodeID" />
                                                            <ext:RecordField Name="CodeValue" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                        </Triggers>
                                        <Listeners>
                                            <Select Handler="this.triggers[0].show();" />
                                            <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                            <TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
                                        </Listeners>
                                    </ext:ComboBox>
                                    <ext:ComboBox ID="cboLoaiToChuc" runat="server" DisplayField="CodeValue" ValueField="CodeID"
                                        EmptyText="Chọn loại tổ chức" Width="150">
                                        <Store>
                                            <ext:Store ID="storeLoaiToChuc" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="CodeID">
                                                        <Fields>
                                                            <ext:RecordField Name="CodeID" />
                                                            <ext:RecordField Name="CodeValue" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                        </Triggers>
                                        <Listeners>
                                            <Select Handler="this.triggers[0].show();" />
                                            <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                            <TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
                                        </Listeners>
                                    </ext:ComboBox>
                                    <ext:TextField ID="txtTenToChuc" runat="server" EmptyText="Tên Tổ Chức"  Width="150"></ext:TextField>
                                </Items>
                            </ext:CompositeField>
                           <ext:CompositeField runat="server" >
                               <Items>
                                   <ext:Button ID="btnClear1" runat="server" Text="Xóa" Width="60" Icon="Delete">
                                    <Listeners>
                                        <Click Handler="#{cboXepHang}.clear();#{cboKhoi}.clear();#{cboLoaiToChuc}.clear();#{txtTenToChuc}.clear();" />
                                    </Listeners>
                                   </ext:Button>
                                   <ext:Button ID="btnSearch" runat="server" Text="Tìm kiếm" Width="60" Icon="Find"
                                       OnDirectClick="btnSearch_Click">
                                   </ext:Button>
                                   <ext:DisplayField runat="server"></ext:DisplayField>
                               </Items>
                               <LayoutConfig Pack="End" />
                           </ext:CompositeField>
                        </Items>
                       <KeyMap>
                        <ext:KeyBinding >
                            <Keys >
                                <ext:Key Code="ENTER" />
                            </Keys>
                            <Listeners >
                                <Event Handler="#{btnSearch}.fireEvent('Click');" />
                            </Listeners>
                        </ext:KeyBinding>
                       </KeyMap>                  
                    </ext:Panel>
                </North>
                <Center>
                    <ext:Panel ID="PnGrid" runat="server" Border="false" Region="Center" Layout="AbsoluteLayout">
                        <Content>
                            <uc:UCSimpleListBase ID="UCSimpleListBase" runat="server" />
                        </Content>
                    </ext:Panel>
                </Center>
            </ext:BorderLayout>
        </Items>
    </ext:Viewport>
    <uc:UCAddToChucHanhChinh ID="UCAddToChucHanhChinh1" runat="server" />
    <uc:UCSimpleDetailBase ID="UCSimpleDetailBase1" runat="server" />
    </form>
</body>
</html>
